﻿using AFanDa.BLL.BLLService;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;

namespace AFanDa.Api.Controllers
{
    /// <summary>
    /// 商品控制器
    /// </summary>
    public class GoodsController : ApiController
    {
        // 商品类
        protected GoodsService _goodsService = null;

        /// <summary>
        /// 商品构造函数
        /// </summary>
        public GoodsController()
        {
            _goodsService = new GoodsService();
        }

        /// <summary>
        /// 获取所有商品
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public IHttpActionResult GetAllGoods()
        {
            var result = _goodsService.GetAllGoods();

            return Ok(result);

        }



    }
}
